package com.dongnao.network.netty_hashcat;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.http.HttpServerCodec;


public class WebServerInit extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        ChannelPipeline pipeline = socketChannel.pipeline();
        //添加http编解码器
        pipeline.addLast(new HttpServerCodec());
        //添加请求分发器
        pipeline.addLast(new DispatcherHandler());
        //添加静态资源处理器
        pipeline.addLast(new StaticFileHandler());
        //添加action处理器
        pipeline.addLast(new ActionHandler());
    }
}
